package com.example.cuibo.androidstudybasicknowadge;

/**
 * Created by cuibo on 2017/10/26.
 */


/*
* 成员变量和局部变量的区别
*/

public class Student {
    /*
    * 属性：名字年龄性别
    * 行为：方法*/

    String name = "张三";
    int age = 23;
    char gender = '男';
    public void  study(){
        System.out.print(name + "在学习");
    }
    public void  seelp(){
        System.out.print(name + "在睡觉");
    }
}

class Phone{
    String brand = "6S";
    int proce = 999999;
    String color = "土豪金";
    public void  call(){
        System.out.print("打电话");
    }
    public void  sendMessage(){
        System.out.print("打电话");
    }
    public void  playGame(){
        System.out.print("打电话");
    }

}
class Demo1Person{
    public static void main(String[] args){
        Person1 p = new Person1();
        p.name = "dayon";
        p.speak();

    }
}
class Person1 {
    String name;
    private int age;
    public void speak(){
      System.out.print(name + "," + age);
    };
    public void setAge(int a){
        age = a;
    }
    public int age(){

        return age;
    }
}
class RectangleTest{
    private int length;
    private int width;
    public RectangleTest(){

    }
    public RectangleTest(int length, int width){
        this.length = length;
        this.width = width;
    };

    public int perimeter(){
      return 2 * (this.length + this.width);
    };
    public int area(){
        return this.length * this.width;
    }
}